#include <myheader_c_plus.h>
using std::cout;
using std::endl;
class Alpah{
public:
    Alpah(){}
    Alpah(int alpah)
    :_Alpha(alpah)
    {

    }

    void print(){
        cout << "Alpah" << endl;
    }
    int getVal(){
        return _Alpha;
    }

private:
    int _Alpha;
    char *_pAlpah;
};

class A : virtual public Alpah{
public:
    A(){
        cout << "A()" << endl;
    }
    A(int a_pri)
    :A_pri(a_pri)
    {

    }

    // void print(){
        // cout << "A" << endl;
    // }

    ~A(){
        cout << "~A()" << endl;
    }
    int getAVal(){
        return A_pri;
    }
private:
    int A_pri;
    char *_pA;
};


class B :virtual public Alpah{
public:
    B(){
        cout << "B()" << endl;
    }
    B(int b_pri)
    :B_pri(b_pri)
    {

    }

    ~B(){
        cout << "~B()" << endl;
    }
    int getBVal(){
        return B_pri;
    }

/*
 *     void print(){
 *         cout << "B" << endl;
 *     }
 *
 */  
private:
    int B_pri;
    char * _pB;
};

class C : public A, public B{
public:
    C(){
        cout << "C()" << endl;
    }

    C(int c_pri)
    :C_pri(c_pri)
    {
        cout << "C(int)" << endl;
    }
    ~C(){
        cout << "~C()" << endl;
    }

    // void print(){
        // cout << "C" << endl;
    // }
    int getCVal(){
        return C_pri;
    }
private:
    int C_pri;
    char * pC;
};
int main(int argc, char *argv[])
{
    Alpah alpah(0);
    C c(3);
    A a(1);
    B b(2);
    cout << a.getAVal() << endl;
    Alpah * pAlpah = &c;
    cout << pAlpah->getVal() << endl;
    pAlpah = &alpah;
    cout << pAlpah->getVal() << endl;
    A * pa = &c;
    pa ->getAVal();
    cout << "============" << endl;
    cout << a.getVal() << endl;
    a = c;
    b = c;


    cout << a.getVal() << endl;
    return 0;
}

